package example;
import facecat.FaceCatScript;
import facecat.topin.core.*;
import facecat.topin.xml.*;
import facecat.topin.tab.*;
import facecat.topin.div.*;
import facecat.topin.btn.*;

/*
 * 横竖布局层示例
 */
public class LayoutDivExample extends FCUIXml
{
    /*
     * 加载Xml
     * @param fileName 文件名
     * @param view 视图名称
     */
   public void loadXml(String fileName, FCView view)
   {
       setScript(new FaceCatScript(this));
       super.loadXml(fileName, view);
       //获取第二页
       FCTabPage tabPage = getTabPage("TabPage2");
       FCLayoutDiv layoutDiv = new FCLayoutDiv();
       layoutDiv.setLocation(new FCPoint(50, 50));
       layoutDiv.setSize(new FCSize(250, 100));
       layoutDiv.setShowHScrollBar(true);
       tabPage.addView(layoutDiv);
       for (int i = 0; i < 10; i++)
       {
           FCButton button = new FCButton();
           button.setSize(new FCSize(100, 20));
           layoutDiv.addView(button);
           button.setText("Button");
       }
   }
}